<template>
    <div id="buyPrize">
        <div id="content">
            <div class="resources-header clearfix">
                <span class="pull-left">
                    <div>
                        <span class="icon maishui mr10"></span> 剩余麦穗值：
                        <span style="color:#ff7342" class="ng-binding">0</span>
                    </div>
                    <div class="maisui-prompt mt5">(1人民币=10麦穗，麦穗用来购买平台奖品，省钱省时间)</div>
                </span>
                <a class="charge pull-right" @click="goToRechargePage">去充值</a>
            </div>
            <div class="add-prize-box">
                <button class="addprizebtn" @click="toCreatePlatformPrize">创建平台奖品</button>
            </div>
            <div class="header-tab">
                <span class="title">奖品类型：</span>
                <ul class="list-unstyled clearfix">
                    <li class="active"><a>全部</a></li>
                    <li><a>三网流量包</a></li>
                    <li><a>三网话费</a></li>
                    <li><a>充值卡</a></li>
                    <li><a>优惠券</a></li>
                    <li><a>电子串码</a></li>
                </ul>
            </div>
            <table class="promotions-table">
                <thead>
                    <tr>
                        <td style="width:15%;">奖品图片</td>
                        <td style="width:15%;">奖品名称</td>
                        <td style="width:10%;">奖品类型</td>
                        <td style="width:15%;">奖品单价</td>
                        <td style="width:10%;">奖品库存</td>
                        <td style="width:15%;">过期时间</td>
                        <td style="width:20%;">操作</td>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>
                            <div class="promotion-img">
                                <img src="https://img-api.huodonghezi.com/uploads/promotionDetail/2017/08/30/14/1504074225X2xd181o.jpg">
                            </div>
                        </td>
                        <td class="ng-binding">爱奇艺视频月卡</td>
                        <td>
                            <span ng-if="promotion.type == 'coupon_code'" class="ng-scope">电子串码</span>
                        </td>
                        <td class="ng-binding">168</td>
                        <td class="ng-binding">71</td>
                        <td class="ng-binding">218天</td>
                        <td>
                            <button class="btn">购买</button>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="promotion-img">
                                <img src="https://img-api.huodonghezi.com/uploads/promotionDetail/2017/08/30/14/1504074225X2xd181o.jpg">
                            </div>
                        </td>
                        <td class="ng-binding">爱奇艺视频月卡</td>
                        <td>
                            <span ng-if="promotion.type == 'coupon_code'" class="ng-scope">电子串码</span>
                        </td>
                        <td class="ng-binding">168</td>
                        <td class="ng-binding">71</td>
                        <td class="ng-binding">218天</td>
                        <td>
                            <button class="btn">购买</button>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="promotion-img">
                                <img src="https://img-api.huodonghezi.com/uploads/promotionDetail/2017/08/30/14/1504074225X2xd181o.jpg">
                            </div>
                        </td>
                        <td class="ng-binding">爱奇艺视频月卡</td>
                        <td>
                            <span ng-if="promotion.type == 'coupon_code'" class="ng-scope">电子串码</span>
                        </td>
                        <td class="ng-binding">168</td>
                        <td class="ng-binding">71</td>
                        <td class="ng-binding">218天</td>
                        <td>
                            <button class="btn">购买</button>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</template>

<script>
	import * as api from './../api/api';
    export default {
        data(){
            return {
               
            }
        },
        mounted(){
            
        },
        computed: {

        },
        methods: {
           goToRechargePage(){
            this.$router.push({name: 'recharge'});
           },
           toCreatePlatformPrize(){
            this.$router.push({name: 'newPlatformPrize'});
           }
        }
        
    }
</script>

<style lang="less" scoped>
    *{
        box-sizing: border-box;
    }
    .add-prize-box{
        background: #ffffff;
        text-align:right;
    }
    .addprizebtn{
        margin-right: 10px;
        margin-top:10px;
        margin-bottom: 10px;
        width: 90px;
        height: 34px;
        line-height: 34px;
        background-color: #11ea6f;
        border-radius: 3px;
        color: #fff;
        font-size: 12px;
        padding: 0;
        text-align: center;
        cursor: pointer;
    }
    .addprizebtn:hover{
        opacity: .9;
    }
    .pull-left {
        float: left!important;
    }
    .pull-right {
        float: right!important;
    }
    .clearfix:after {
        display: block;
        content: "";
        visibility: hidden;
        height: 0;
        clear: both;
    }
    #buyPrize{
        background: #f4f8fb;
        padding: 40px;
        #content{
            .resources-header{
                background-color: #fff;
                padding: 10px;
                margin-bottom: 20px;
                .maishui {
                    width: 14px;
                    height: 14px;
                    background-image: url('../assets/img/dashboard_maishui.png');
                }
                .icon {
                    display: inline-block;
                    background-size: 100% auto;
                    background-repeat: no-repeat;
                    vertical-align: middle;
                    position: relative;
                    top: -1px;
                }
                .maisui-prompt {
                    font-size: 12px;
                    color: #999;
                    margin-top: 5px;
                }
                .charge {
                    margin-left: 30px;
                    width: 90px;
                    height: 34px;
                    line-height: 34px;
                    background-color: #ec5463;
                    border-radius: 3px;
                    color: #fff;
                    font-size: 12px;
                    padding: 0;
                    text-align: center;
                    cursor:pointer;
                }
            }
            .header-tab{
                width: 100%;
                height: 60px;
                border: 1px solid #efefef;
                position: relative;
                padding-left: 85px;
                padding-top: 17px;
                color: #888;
                font-size: 12px;
                background-color: #fff;
                .title {
                    position: absolute;
                    left: 30px;
                    top: 23px;
                }
                .list-unstyled {
                    padding-left: 0;
                    list-style: none;
                    li.active{
                        background-color: #ec5463;
                        a{
                            color:#ffffff;
                        }
                    }
                    li{
                        float: left;
                        padding: 0 10px;
                        margin: 0 10px;
                        line-height: 28px;
                        cursor: pointer;
                        border-radius: 2px;
                        a{
                            width: 100%;
                            height: 100%;
                            display: block;
                            color: #888;
                        }
                    }
                }
            }
            .promotions-table {
                width: 100%;
                border: 1px solid #efefef;
                border-top: 0;
                box-sizing: border-box;
                margin-top: 20px;
                text-align: center;
                border-collapse: collapse;
                border-spacing: 0;
                thead{
                    background-color: #f1f1f1;
                    font-size: 14px;
                    td{
                        height: 50px;
                    }
                }
                tbody{
                    background-color: #fff;
                    color: #888;
                    tr:hover{
                        background: #effdfc;
                    }
                    tr:hover>td:first-child{
                        border-color:#20a0ff;
                    }
                    tr{
                        border-bottom: 1px solid #efefef;
                        td{
                            height: 60px;
                            font-size: 12px;
                            .promotion-img {
                                width: 45px;
                                height: 45px;
                                margin: 0 auto;
                                overflow: hidden;
                                img{
                                    width:100%;
                                    height: 100%;
                                }
                            }
                            .btn{
                                width: 90px;
                                line-height: 34px;
                                border-radius: 3px;
                                padding: 0;
                                color: #fff;
                                font-size: 12px;
                                background-color: #ec5463;
                                height: 34px;
                                display: inline-block;
                                margin-bottom: 0;
                                font-weight: 400;
                                text-align: center;
                                vertical-align: middle;
                                touch-action: manipulation;
                                cursor: pointer;
                                border: 1px solid transparent;
                                white-space: nowrap;
                                user-select: none;
                            }
                        }
                        td:first-child {
                            border-left: 3px solid #fff;
                        }
                    }
                }
            }
        }
    }

</style>
